<!-- 邀请奖励设置 -->
<div class="search">
  <nz-select style="width:100px;margin-right: 5px;" [(ngModel)]="status" nzAllowClear nzPlaceHolder="使用状态"
    (ngModelChange)="searchData()">
    <nz-option *ngFor="let item of statuslist" [nzValue]="item.key" [nzLabel]="item.value"></nz-option>
  </nz-select>
  <nz-cascader nzChangeOnSelect [(ngModel)]="areas" nzPlaceHolder="所在城市" [nzLabelProperty]="'lable'"
      [nzValueProperty]="'value'" [nzOptions]="nzOptions" (ngModelChange)="onChanges($event)"> </nz-cascader>
  <nz-input-group nzSuffixIcon="anticon anticon-search" style="width:60%;margin-left:1rem;">
    <input type="text" nz-input placeholder="输入城市名称查询" [(ngModel)]="title" (keyup.enter)="searchData()">
  </nz-input-group>
  <a (click)="searchData()">查询</a>
  <a (click)="add()">添加</a>
</div>

<nz-table #ajaxTable nzShowSizeChanger [nzFrontPagination]="false" [nzData]="dataSet" [nzLoading]="loading" [nzTotal]="total"
  [nzShowTotal]="totalTemplate" [(nzPageIndex)]="pageIndex" [(nzPageSize)]="pageSize" (nzPageIndexChange)="searchData()"
  (nzPageSizeChange)="searchData(true)" [nzScroll]="{ x:'1500px',y: '400px' }">
  <thead>
    <tr>
      <th nzWidth="60px" nzLeft="0px">序号</th>
      <th nzWidth="80px">省份</th>
      <th nzWidth="80px">城市</th>
      <th nzWidth="80px">区县</th>
      <th nzWidth="80px">奖励时限</th>
      <th nzWidth="120px">第一批邀请人数</th>
      <th nzWidth="120px">第一批邀请奖励金额</th>
      <th nzWidth="120px">第二批邀请人数</th>
      <th nzWidth="120px">第二批邀请奖励金额</th>
      <th nzWidth="120px">第三批邀请人数</th>
      <th nzWidth="120px">第三批邀请奖励金额</th>
      <th nzWidth="80px">状态</th>
      <th nzWidth="100px">创建人</th>
      <th nzWidth="120px">更新时间</th>
      <th nzWidth="80px" nzRight="0px">操作</th>
    </tr>
  </thead>
  <tbody>
    <tr *ngFor="let data of ajaxTable.data;index as i">
      <td nzLeft="0px">{{i+1}}</td>
      <td>{{data.province}}</td>
      <td>{{data.city}}</td>
      <td>{{data.district}}</td>
      <td>{{data.time}}</td>
      <td>{{data.fnum}}</td>
      <td>{{data.fmoney}}</td>
      <td>{{data.snum}}</td>
      <td>{{data.smoney}}</td>
      <td>{{data.tnum}}</td>
      <td>{{data.tmoney}}</td>
      <td>{{data.status}}</td>
      <td>{{data.createuser.name}}</td>
      <td>{{data.updateTime | date:"yyyy-MM-dd HH:mm"}}</td>

      <td nzRight="0px">
        <a *ngIf="data.status=='有效'" (click)="lock(data._id)">禁用</a>
        <a *ngIf="data.status!='有效'" (click)="open(data._id)">启用</a>
        <a (click)="edit(data._id)">编辑</a>
      </td>
    </tr>
  </tbody>
</nz-table>

<ng-template #totalTemplate let-total>
  共 {{total}} 条
</ng-template>
<nz-modal [(nzVisible)]="isVisible" nzTitle="邀请奖励设置" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"
  nzWrapClassName="vertical-center-modal" [nzMaskClosable]="false" nzWidth="800">
  <div style="margin-bottom: 16px;" class="scrollbar my-modal">
    <nz-input-group nzAddOnBefore="所在城市">
      <nz-cascader nzChangeOnSelect [(ngModel)]="addareas" nzPlaceHolder="所在城市" [nzLabelProperty]="'lable'"
      [nzValueProperty]="'value'" [nzOptions]="nzOptions" (ngModelChange)="onChanges($event)"> </nz-cascader>
    </nz-input-group>
    <nz-input-group nzAddOnBefore="奖励时限">
      <input type="text" nz-input [(ngModel)]="doc.time">
    </nz-input-group>
    <nz-input-group nzAddOnBefore="第一批邀请人数">
      <input type="text" nz-input [(ngModel)]="doc.fnum">
    </nz-input-group>
    <nz-input-group nzAddOnBefore="第一批邀请奖励金额">
      <input type="text" nz-input [(ngModel)]="doc.fmoney">
    </nz-input-group>
    <nz-input-group nzAddOnBefore="第二批邀请人数">
      <input type="text" nz-input [(ngModel)]="doc.snum">
    </nz-input-group>
    <nz-input-group nzAddOnBefore="第二批邀请奖励金额">
      <input type="text" nz-input [(ngModel)]="doc.smoney">
    </nz-input-group>
    <nz-input-group nzAddOnBefore="第三批邀请人数">
      <input type="text" nz-input [(ngModel)]="doc.tnum">
    </nz-input-group>
    <nz-input-group nzAddOnBefore="第三批邀请奖励金额">
      <input type="text" nz-input [(ngModel)]="doc.tmoney">
    </nz-input-group>
  </div>